POV-Ray : Newsgroups : povray.advanced-users : Need help creating "flat" quadradural panels with smooth_triangle : Re: Need help creating "flat" quadradural panels with smooth_triangle Server Time
28 Jul 2024 12:23:40 EDT (-0400)
  Re: Need help creating "flat" quadradural panels with smooth_triangle  
From: Mesh Mongrel
Date: 20 Oct 2005 16:25:01
Message: <web.4357fbd1748e455f0b7e880@news.povray.org>
Update:

I think I figured out that the normal I was calculating was the normal for
each vertex rather than the normal for the plane.  My misunderstanding.  If
I understand that correctly than I should need to calculate 6 vectors and
average them together rather than 2.

So I have tried this:

mesh {
        #local P1 = <x1, y1, z1>;
        #local P2 = <x2, y2, z2>;
        #local P3 = <x3, y3, z3>;
        #local P4 = <x4, y4, z4>;
        #local N1 = vnormalize(vcross(P3 - P1, P2 - P1));
        #local N2 = vnormalize(vcross(P1 - P2, P3 - P2));
        #local N3 = vnormalize(vcross(P1 - P3, P2 - P3));
        #local N4 = vnormalize(vcross(P4 - P3, P2 - P3));
        #local N5 = vnormalize(vcross(P3 - P2, P4 - P2));
        #local N6 = vnormalize(vcross(P3 - P4, P2 - P4));
        #local N = (N1 + N2 + N3 + N4 + N5 + N6)/6;
        smooth_triangle { P1, N, P2, N, P3, N }
        smooth_triangle { P2, N, P3, N, P4, N }
}


I still end up with the same shading problem.

I'd love to know what I'm missing.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.